package yz;

import java.util.Arrays;

/**
 * [344. 反转字符串](https://leetcode-cn.com/problems/reverse-string/)
 *
 * @author Yz
 * @since 2022-09-07 15:28
 */
public class LeetCode344_ReverseString {
    
    public void reverseString(char[] s) {
        int begin = 0;
        int end = s.length - 1;
        char temp;
        while (begin < end) {
            temp = s[begin];
            s[begin] = s[end];
            s[end] = temp;
            begin++;
            end--;
        }
        System.out.println(Arrays.toString(s));
    }
}
